var url = 'http://47.108.197.28:8000/top250'
var ad = 'http://47.108.197.28:8000/ad'

$ajax({
    url,
    success:res=>{
        var result = res.result;
        // console.log(result)
        result.forEach(item=> {
            var {pic,title,raiting,evaluate,labels,slogo} = item;
            var labels = labels.join("/");
            var template = `
            
            <div class="detail">
                <div class="number"><img src="https://images.weserv.nl/?url=${pic}" alt=""></div>
                <div class="text">
                    <p>${title} <span> [可播放]</span></p>
                    <p>导演: 弗兰克·德拉邦特 Frank Darabont   主演: 蒂姆·罗宾斯 Tim Robbins /...</p>
                    <p>${labels}</p>
                    <p><span> ${raiting} </span> ${evaluate}人评价</p>
                    <p>"${slogo}"</p>
                </div>
            </div>
            `
            $(".left-content").append(template)

        })
    }
})

$ajax({
    url:ad,
    success:res=>{
        var result = res.result;
       
            var template = `
            

            <div class="adv-text">
         ${result.title}
        </div>
        <div class="infor">
            <div><img src="${result.erweima}" alt=""></div>
            <div>
                <img src="${result.logo}" alt="">
                
            </div>
            <div>
                <p>${result.labels[0]}</p>
                <p>${result.labels[1]}</p></div>
        </div>
            `
            $(".right-adv").append(template)
        
    }
})